﻿using System;
using System.Collections.Generic;

namespace diantou.dataModel
{
    /// <summary>
    /// 企业考试
    /// </summary>
    [fastCSharp.emit.jsonSerialize(IsAllMember = true)]
    [fastCSharp.emit.jsonParse(IsAllMember = true)]
    [fastCSharp.emit.dataSerialize(IsReferenceMember = false)]
    [fastCSharp.code.cSharp.webView.clientType(Name = "diantou.exam")]
    [fastCSharp.code.cSharp.sqlModel(LogTcpCallService = "ExamDataLog")]
    public partial class exam
    {
        /// <summary>
        /// 评论标识
        /// </summary>
        [fastCSharp.code.cSharp.webView.outputAjax]
        public int Id;
        /// <summary>
        /// 用户标识
        /// </summary>
        public int UserId;
        /// <summary>
        /// 起始时间
        /// </summary>
        public DateTime StartTime;
        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime EndTime;
        /// <summary>
        /// 标题
        /// </summary>
        [fastCSharp.emit.dataMember(MaxStringLength = 64)]
        public string Title;
        /// <summary>
        /// 图片
        /// </summary>
        [fastCSharp.emit.dataMember(MaxStringLength = 256, IsAscii = true)]
        public sqlMember.image Image = string.Empty;
        /// <summary>
        /// 最长时间
        /// </summary>
        public int MaxMinutes;
        /// <summary>
        /// 随时通知考生参加的考试 最大考试人数
        /// </summary>
        public int MaxUserCount = 10;
        /// <summary>
        /// 考试类型
        /// </summary>
        public enum type : byte
        {
            All,
            随时通知考生参加的考试,
            考生熟悉环境的测试赛,
            预先指定考生的考试,
            完成答卷后发简历的考试,
            预先注册的考试
        }
        /// <summary>
        /// 考试类型
        /// </summary>
        public type Type = type.随时通知考生参加的考试;
        /// <summary>
        /// 考试状态
        /// </summary>
        public enum status : byte
        {
            All,
            /// <summary>
            /// 未发布
            /// </summary>
            None,
            /// <summary>
            /// 已发布
            /// </summary>
            Published,
        }
        /// <summary>
        /// 考试状态
        /// </summary>
        public status Status;
        /// <summary>
        /// 考试状态数量
        /// </summary>
        public static readonly int StatusSize = fastCSharp.Enum.GetMaxValue<status>(-1) + 1;
        /// <summary>
        /// 邮件发送次数
        /// </summary>
        public byte MailCount = 10;
        /// <summary>
        /// 编程题评分设置
        /// </summary>
        public enum problemPointSetting : byte
        {
            按照比例得分,
            有错得分减半,
            有错不得分,
        }
        /// <summary>
        /// 编程题评分设置
        /// </summary>
        public problemPointSetting ProblemPointSetting;
        /// <summary>
        /// 编程题测试设置
        /// </summary>
        public enum problemJudgeSetting : byte
        {
            只运行部分测试,
            运行所有测试,
        }
        /// <summary>
        /// 编程题测试设置
        /// </summary>
        public problemJudgeSetting ProblemJudgeSetting;
        /// <summary>
        /// 是否支持摄像头
        /// </summary>
        public bool IsCamera;
        /// <summary>
        /// 是否支持实时监考
        /// </summary>
        public bool IsRealCamera;
        /// <summary>
        /// 是否记录考试日志
        /// </summary>
        public bool IsLog;
        /// <summary>
        /// 编程题是否检测代码相似度
        /// </summary>
        public bool IsCheckProgram;
        /// <summary>
        /// 是否发送过考试结束通知
        /// </summary>
        [fastCSharp.emit.dataSerialize.member(IsIgnoreCurrent = true)]
        public bool IsFinallyNotice;

        /// <summary>
        /// 考试描述
        /// </summary>
        [fastCSharp.emit.dataMember(MaxStringLength = 64 << 10)]
        public string Description = string.Empty;
        /// <summary>
        /// 考试结束描述
        /// </summary>
        [fastCSharp.emit.dataMember(MaxStringLength = 64 << 10)]
        public string FinishDescription = string.Empty;

        ///// <summary>
        ///// 评审人员标识集合
        ///// </summary>
        //[fastCSharp.emit.dataMember(Group = 2)]
        //public fastCSharp.sql.jsonMember<HashSet<int>> ReviewUserIds;

        #region 计算列
        /// <summary>
        /// 单选题数量
        /// </summary>
        [fastCSharp.emit.dataMember(IsIgnoreCurrent = true, IsSqlStream = true)]
        public int RadioCount;
        /// <summary>
        /// 多选题数量
        /// </summary>
        [fastCSharp.emit.dataMember(IsIgnoreCurrent = true, IsSqlStream = true)]
        public int MultipleChoiceCount;
        /// <summary>
        /// 问答题数量
        /// </summary>
        [fastCSharp.emit.dataMember(IsIgnoreCurrent = true, IsSqlStream = true)]
        public int QuestionCount;
        /// <summary>
        /// 问答题分数
        /// </summary>
        [fastCSharp.emit.dataMember(IsIgnoreCurrent = true, IsSqlStream = true)]
        public int QuestionPoint;
        /// <summary>
        /// 编程题数量
        /// </summary>
        [fastCSharp.emit.dataMember(IsIgnoreCurrent = true, IsSqlStream = true)]
        public int ProblemCount;
        /// <summary>
        /// 编程题分数
        /// </summary>
        [fastCSharp.emit.dataMember(IsIgnoreCurrent = true, IsSqlStream = true)]
        public int ProblemPoint;
        /// <summary>
        /// 考试人数
        /// </summary>
        [fastCSharp.emit.dataMember(IsIgnoreCurrent = true, IsSqlStream = true)]
        public int UserCount;
        /// <summary>
        /// 考试注册人数
        /// </summary>
        [fastCSharp.emit.dataMember(IsIgnoreCurrent = true, IsSqlStream = true)]
        public int RegisterCount;
        /// <summary>
        /// 答题人数
        /// </summary>
        [fastCSharp.emit.dataMember(IsIgnoreCurrent = true, IsSqlStream = true)]
        public int AnswerUserCount;
        /// <summary>
        /// 工作职位数量
        /// </summary>
        [fastCSharp.emit.dataMember(IsIgnoreCurrent = true, IsSqlStream = true)]
        public int JobCount;
        /// <summary>
        /// 已经结束考试的试卷数量
        /// </summary>
        [fastCSharp.emit.dataMember(IsIgnoreCurrent = true, IsSqlStream = true)]
        public int PaperCount;
        /// <summary>
        /// 邀请数量
        /// </summary>
        [fastCSharp.emit.dataMember(IsIgnoreCurrent = true, IsSqlStream = true)]
        public int InvitationCount;
        #endregion
    }
}
